//来自controllers/admin/UserController内
//处理前端传来的数据

const { upload } = require("../../controllers/admin/UserController")
const UserModel = require("../../models/UserModel")

const UserService = {
	//处理登陆信息的接口
	login: async({username, password}) =>{
		return UserModel.find({
			username,
			password
		})
	},
	//处理更新个人信息的接口
	upload:async({
		_id,username,introduction,gender,avatar
	})=>{
		return UserModel.updateOne({
			_id
		},{
			username,introduction,gender,avatar
		})
	}
}

module.exports = UserService
